package com.fzsf.drawingboard.bluetooth.iskn;

import android.bluetooth.BluetoothDevice;

import com.fzsf.drawingboard.bluetooth.FZWritingPadConstant;
import com.fzsf.drawingboard.bluetooth.IFZWritingPad;
import com.fzsf.drawingboard.bluetooth.IFZWritingPadCallBackListener;

/**
 * Created by Taijl on 2018/3/1.
 */

public class FZWritingPad_ISKN implements IFZWritingPad {
    /**
     * need setFZWritingPadCallBackListener first
     */
    @Override
    public void scanDevice() {
        FZWritingPad_ISKNHelper.getInstance().startScan();
    }

    @Override
    public void connectDevice(BluetoothDevice device) {
        FZWritingPad_ISKNHelper.getInstance().connectDevice(device);
    }

    @Override
    public void connectDeviceByName(String deviceName) {
        throw new RuntimeException("can't use ISKN connectDeviceByName ");
    }

    @Override
    public boolean getConnectState() {
        return FZWritingPad_ISKNHelper.getInstance().isConnected();
    }

    @Override
    public void switchWorkMode(int workMode) {
        FZWritingPad_ISKNHelper.getInstance().switchWorkMode(workMode);
    }

    @Override
    public void disConnect() {
        FZWritingPad_ISKNHelper.getInstance().disConnect();
    }

    @Override
    public void setFZWritingPadCallBackListener(IFZWritingPadCallBackListener listener) {
        FZWritingPad_ISKNHelper.getInstance().setFZWritingPadCallBackListener(listener);
    }

    @Override
    public int getDefinitePadType() {
        return FZWritingPadConstant.FZWritingPadType.TYPE_ISKN;
    }
}
